Skip to main content

ListFromJObjectArray

Type

handler

Summary

Convert a java object array into a List of java objects

Syntax

ListFromJObjectArray(<pObj>)

Description

Use ListFromJObjectArray to convert pObj into a List of JObjects.

Parameters

NameTypeDescription

pObj

The JObjectArray to convert

Examples

    __safe foreign handler _JNI_IntentGetStringArrayExtra(in pIntent as JObject, \
in pType as JString) \
returns JObjectArray \
binds to "java:android.content.Intent>getStringArrayExtra(Ljava/lang/String;)[Ljava/lang/String;"

handler OnActivityResultListener(\
in pRequestCode as JObject, \
in pResultCode as JObject, \
in pIntent as optional JObject) returns nothing

if pResultCode is -1 then
variable tArray as JObjectArray
put _JNI_IntentGetStringArrayExtra(pIntent, \
StringToJString("android.intent.extra.MIME_TYPES")) into tArray
variable tList as List
put ListFromJObjectArray(tArray) into tList

variable tStringList as List
variable tString as JObject
repeat for each element tString in tList
push StringFromJObject(tString) onto back of tStringList
end repeat

post "mimeTypes" with [tStringList]
end if

end handler
Thank you for your feedback!

Was this page helpful?